﻿<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - 网上书城后台管理</title>

    <!-- 核心样式 -->
    <link href="~/Content/bootstrap.min.css" rel="stylesheet" />
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <!-- 自定义样式 -->
    <style>
        :root {
            --primary-color: #4361ee;
            --secondary-color: #3f37c9;
            --success-color: #06d6a0;
            --danger-color: #ef476f;
            --light-bg: #f8f9fa;
        }

        body {
            background-color: var(--light-bg);
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        /* 头部导航 */
        .admin-header {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            box-shadow: 0 2px 15px rgba(0,0,0,0.1);
        }

        .admin-nav {
            background: rgba(255,255,255,0.95);
            backdrop-filter: blur(5px);
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }

        .nav-link {
            color: #495057 !important;
            border-radius: 8px;
            transition: all 0.3s ease;
            position: relative;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .nav-link:hover,
        .nav-link.active {
            background: rgba(var(--primary-color), 0.1);
            color: var(--primary-color) !important;
        }

        .nav-link.active:after {
            content: '';
            position: absolute;
            bottom: -8px;
            left: 50%;
            transform: translateX(-50%);
            width: 60%;
            height: 3px;
            background: var(--primary-color);
            border-radius: 2px;
        }

        /* 主内容区 */
        .main-content {
            background: white;
            border-radius: 12px;
            box-shadow: 0 4px 24px rgba(0,0,0,0.06);
            margin-top: 2rem;
            padding: 2rem;
            flex: 1;
        }

        /* 表格优化 */
        .table-hover tbody tr {
            transition: transform 0.2s, box-shadow 0.2s;
        }

        .table-hover tbody tr:hover {
            transform: translateX(4px);
            box-shadow: 4px 0 0 0 var(--primary-color);
        }

        .table thead th {
            border-bottom: 2px solid var(--primary-color);
            font-weight: 600;
        }

        /* 按钮增强 */
        .btn-admin {
            padding: 0.5rem 1rem;
            border-radius: 8px;
            font-weight: 500;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .btn-edit {
            background: linear-gradient(45deg, #4cc9f0, #4361ee);
            color: white !important;
        }

        .btn-add {
            background: linear-gradient(45deg, #06d6a0, #04b082);
            color: white !important;
        }

        .btn-delete {
            background: linear-gradient(45deg, #ef476f, #d90429);
            color: white !important;
        }

        /* 响应式优化 */


        /* 加载动画 */
        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(255,255,255,0.8);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 9999;
        }

        .spinner {
            width: 3rem;
            height: 3rem;
            border: 4px solid var(--primary-color);
            border-top-color: transparent;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        @@keyframes spin {
            to { transform: rotate(360deg); }
        }
            /* 新增导航栏样式 */
        .navbar-nav {
            align-items: center;
        }

        /* 响应式调整 */


        /* 增强间距效果 */
        .gap-3 {
            gap: 1rem !important;
        }
    </style>

    @RenderSection("styles", required: false)
</head>
<body>
    <!-- 加载动画 -->
    <div class="loading-overlay">
        <div class="spinner"></div>
    </div>

    <header class="admin-header">
        <nav class="navbar navbar-expand-lg navbar-dark">
            <div class="container">
                <!-- 左侧品牌标识 -->
                <a class="navbar-brand" href="#">
                    <i class="fas fa-book-open me-2"></i>
                    网上书城后台
                </a>

                <!-- 移动端折叠按钮 -->
                <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#adminNav">
                    <span class="navbar-toggler-icon"></span>
                </button>

                <!-- 导航内容 -->
                <div class="collapse navbar-collapse" id="adminNav">
                    <!-- 中间功能菜单 -->
                    <ul class="navbar-nav mx-auto gap-3">
                        <!-- 添加间距 -->
                        <li class="nav-item">
                            <a class="nav-link @IsActive("Index", "AdminDashboard")"
                               href="@Url.Action("Index", "AdminDashboard")">
                                <i class="fas fa-home"></i>
                                仪表盘
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link @IsActive("GetAdmin", "AdministrationInfo")"
                               href="@Url.Action("GetAdmin", "AdministrationInfo")">
                                <i class="fas fa-user-shield"></i>
                                管理员管理
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link @IsActive("GetBookList", "BookDetailsInfo")"
                               href="@Url.Action("GetBookList", "BookDetailsInfo")">
                                <i class="fas fa-book"></i>
                                书籍管理
                            </a>
                        </li>
                    </ul>

                    <!-- 右侧退出按钮 -->
                    <div class="navbar-nav ms-lg-3">
                        <a class="nav-link btn-admin btn-danger" href="@Url.Action("Index", "ShopInfo")">
                            <i class="fas fa-sign-out-alt"></i>
                            退出系统
                        </a>
                    </div>
                </div>
            </div>
        </nav>
    </header>
    <main class="container py-4 flex-grow-1">
        @RenderBody()
    </main>

    <footer class="bg-light py-4 mt-auto">
        <div class="container text-center text-secondary">
            <p class="mb-0">&copy; @DateTime.Now.Year - 网上书城 MVC 后台管理系统</p>
            <small>技术支持：技术部 | 版本：2.1.0</small>
        </div>
    </footer>

    <!-- 脚本 -->
    <script src="~/Scripts/jquery-3.6.0.min.js"></script>
    <script src="~/Scripts/bootstrap.bundle.min.js"></script>
    <script>
        @functions {
    // 动态激活状态判断方法
    private string IsActive(string action, string controller)
    {
        var currentAction = ViewContext.RouteData.Values["action"]?.ToString();
        var currentController = ViewContext.RouteData.Values["controller"]?.ToString();
        return (action == currentAction && controller == currentController) ? "active" : "";
    }
}
        // 全局加载动画控制
        $(document).ajaxStart(function () {
            $('.loading-overlay').fadeIn();
        }).ajaxStop(function () {
            $('.loading-overlay').fadeOut();
        });

        // 表格行点击效果
        $('.table-hover tbody tr').click(function () {
            $(this).toggleClass('table-active');
        });

        // 工具提示初始化
        $(function () {
            $('[data-bs-toggle="tooltip"]').tooltip()
        })
    </script>
    @RenderSection("scripts", required: false)
</body>
</html>